package fr.utbm.aiechat.structures;

import java.io.Serializable;

import android.content.Context;
import android.content.Intent;
import fr.utbm.aiechat.Network;

// This class represent a Conversation
public class Conversation implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Intent intent;
	private Channel chan;
	
	public Conversation(Context context, Channel chan) 
	{
		//intent = new Intent(context, ConversationActivity.class);
		this.chan = chan;
	}
	
	public String getName()
	{
		return chan.getName();
	}
	
	public Channel getChannel()
	{
		return chan;
	}
	
	public Intent getIntent()
	{
		return intent;
	}

	public static void removeConversByUniquedId(int uniqueID) {
		for (int i = 0 ; i < Network.getInstance().Conversations.getCount() ; i++) {
			Conversation convers = Network.getInstance().getConversation(i);
			if (convers.chan.getUniqueID() == uniqueID) {
				Network.getInstance().Conversations.remove(convers);
			}
		}
	}
}
